//
//  OrderItemsViewController.m
//  Assistant
//
//  Created by liaozhenming on 16/6/6.
//  Copyright © 2016年 liaozhenming. All rights reserved.
//

#import "OrderItemsViewController.h"

#import "OrderEditViewController.h"

@implementation OrderItemsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.tableView.tableFooterView = [UIView new];
    UIBarButtonItem *rigthItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemAdd target: self action: @selector(action_edit:)];
    self.navigationItem.rightBarButtonItem = rigthItem;
    
    UISegmentedControl *typeSegmented = [[UISegmentedControl alloc] initWithItems: @[@"全部",@"采购单",@"代购单"]];
    typeSegmented.selectedSegmentIndex = 0;
    self.navigationItem.titleView = typeSegmented;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Private methods

- (void)action_edit:(UIBarButtonItem*)item {
    
    OrderEditViewController *editViewController = [OrderEditViewController kk_viewControllerFromStoryboard];
    [self kk_pushViewController: editViewController];
}

#pragma mark - UITableView methods
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return CGFLOAT_MIN;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return CGFLOAT_MIN;
}

- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    UITableViewCell *cell = [UITableViewCell kk_cellWithTableView: tableView];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
}

@end
